package com.swpu.project.controller;


import com.swpu.project.common.BaseResponse;
import com.swpu.project.model.entity.User;
import com.swpu.project.service.LoginService;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author swpuyanxiegroup1
 * @since 2024-07-29
 */

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class LogController {
    @Resource
    LoginService loginService;
    @PostMapping("/user/login")
    public BaseResponse login(@RequestBody User user)
    {
        return loginService.login(user);

    }
    @GetMapping("/user/logout")
    public BaseResponse logout()
    {

        return loginService.logout();


    }




}